package com.qfmy.webapp.controller.wallpaper;

import com.qfmy.common.result.Result;
import com.qfmy.model.vo.wallpaper.WallpaperVo;
import com.qfmy.webapp.service.wallpaper.WallpaperService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 清风明月
 * @Package com.qfmy.web.app.controller.wallpaper
 * @date 2025/11/26
 * @description 壁纸表
 */
@RestController
@SuppressWarnings("all")
@RequestMapping("/app/wallpaper")
public class WallpaperController {

    /**
     * 注入壁纸服务
     */
    @Autowired
    private WallpaperService wallpaperService;

    /**
     * 每日推荐优秀的壁纸
     */
    @RequestMapping("/getJingXuanWallpapers")
    public Result<List<WallpaperVo>> getJingXuanWallpapers() {
        List<WallpaperVo> list = wallpaperService.getJingXuanWallpapers();
        return Result.ok(list);
    }

    /**
     * 根据分类id分页获取壁纸
     */
    @RequestMapping("/getWallpapersByCategoryId")
    public Result<List<WallpaperVo>> getWallpapersByCategoryId(@RequestParam Integer categoryId,@RequestParam Integer pageNum,@RequestParam Integer pageSize) {
        List<WallpaperVo> list = wallpaperService.getWallpapersByCategoryId(categoryId, pageNum, pageSize);
        return Result.ok(list);
    }


}
